import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ExtractWord {
	public static void main(String[] args) {
		String text = "Вelcome to our Java course!";
		// By default, case-insensitive matching assumes that only characters in
		// the US-ASCII charset are being matched.
//		Pattern pattern = Pattern.compile("вelcome", Pattern.CASE_INSENSITIVE
//				| Pattern.UNICODE_CASE);
		Pattern pattern = Pattern.compile("(?iu)вelcome");
		Matcher matcher = pattern.matcher(text);
		while (matcher.find()) {
			int start = matcher.start();
			int end = matcher.end();
			String match = text.substring(start, end);
			System.out.println(match);
		}

	}
}
